<?php

/**
 * publish actions.
 *
 * @package    BCWeb
 * @subpackage publish
 * @author     Jhonny Fuentes
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class publishActions extends sfActionsDependentSelect{
//        protected function getValuesForPersonPais($request, $source)
//    {
//        // in this case we work with objects, but you can do it anyway
//        // always returning an array with an id as a key
//        // and the text as the array values.
//
//        $valores = array();
//        $paises = PaisTable::getInstance()->createQuery('p')
////            ->where('p.pais_id = ? and p.es_productora = true')
//            ->execute($request->getParameter('_ds_ref'));
//
//        // the _ds_ref  parameter contains the select value wich it depends
//        // in this case will be the value for pais.id
//
//        foreach ($paises as $provincia) {
//            $valores[$provincia->getId()] = $provincia->getNombre();
//        }
//
//        return $valores;
//    }
//    protected function getRefValueForPersonPais($request, $source)
//    {
//        // this method is used in order to "rebuild" the selects chain
//        // depending of inverse order. It means Only if you have
//        // the province value, you have to know wich country it belong to
//        // in order to select it from the country select.
//        // in this case the value of _ds_ref is the actual value of the select
//        // of provinces (provincia.id) and we have to return wich country
//        // it belongs (provincia.pais_id)
//
//        $provincia = ProvinciaTable::getInstance()->find($request->getParameter('_ds_ref'));
//        return $provincia->getPaisId();
//    }
//    protected function getValuesForPaisProvincia($request, $source)
//    {
//        // in this case we work with objects, but you can do it anyway
//        // always returning an array with an id as a key
//        // and the text as the array values.
//
//        $valores = array();
//        $provincias = ProvinciaTable::getInstance()->createQuery('p')
//            ->where('p.pais_id = ?')
//            ->execute($request->getParameter('_ds_ref'));
//
//        // the _ds_ref  parameter contains the select value wich it depends
//        // in this case will be the value for pais.id
//
//        foreach ($provincias as $provincia) {
//            $valores[$provincia->getId()] = $provincia->getNombre();
//        }
//
//        return $valores;
//    }
//
//    protected function getRefValueForPaisProvincia($request, $source)
//    {
//        // this method is used in order to "rebuild" the selects chain
//        // depending of inverse order. It means Only if you have
//        // the province value, you have to know wich country it belong to
//        // in order to select it from the country select.
//        // in this case the value of _ds_ref is the actual value of the select
//        // of provinces (provincia.id) and we have to return wich country
//        // it belongs (provincia.pais_id)
//
//        $provincia = ProvinciaTable::getInstance()->find($request->getParameter('_ds_ref'));
//        return $provincia->getPaisId();
//    }
    
//    protected function getValuesForPersonaProvincia($request, $source)
//    {
//        // in this case we work with objects, but you can do it anyway
//        // always returning an array with an id as a key
//        // and the text as the array values.
//
//        $valores = array();
//        $provincias = ProvinciaTable::getInstance()->createQuery('p')
//            ->where('p.pais_id = ? and p.es_productora = true')
//            ->execute($request->getParameter('_ds_ref'));
//
//        // the _ds_ref  parameter contains the select value wich it depends
//        // in this case will be the value for pais.id
//
//        foreach ($provincias as $provincia) {
//            $valores[$provincia->getId()] = $provincia->getNombre();
//        }
//
//        return $valores;
//    }
//
// 
//    protected function getRefValueForPersonaProvincia($request, $source)
//    {
//        // this method is used in order to "rebuild" the selects chain
//        // depending of inverse order. It means Only if you have
//        // the province value, you have to know wich country it belong to
//        // in order to select it from the country select.
//        // in this case the value of _ds_ref is the actual value of the select
//        // of provinces (provincia.id) and we have to return wich country
//        // it belongs (provincia.pais_id)
//
//        $provincia = ProvinciaTable::getInstance()->find($request->getParameter('_ds_ref'));
//        return $provincia->getPaisId();
//    }
//    protected function getRefValueForPais($request, $source)
//    {
//        // this method is used in order to "rebuild" the selects chain
//        // depending of inverse order. It means Only if you have
//        // the province value, you have to know wich country it belong to
//        // in order to select it from the country select.
//        // in this case the value of _ds_ref is the actual value of the select
//        // of provinces (provincia.id) and we have to return wich country
//        // it belongs (provincia.pais_id)
//
//        $provincia = PaisTable::getInstance()->find($request->getParameter('_ds_ref'));
//        return $provincia->getPaisId();
//    }
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request){
      $this->form = new PersonForm();
//      $this->form = $this->newForm('InstitutionForm');
//    $this->forward('default', 'module');
  }
}
